package com.ahm.server.utils;

import com.ahm.server.pojo.Admin;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * @author anhaimeng
 * @title: AdminUtils
 * @projectName yeb001
 * @description: TODO
 * @date 2021/9/2319:56
 */
/*功能描述
 * @author ahm
 */
public class AdminUtils {

    /**
    　　* @description: 获取当前用户的id
    　　* @param ${tags}
    　　* @return ${return_type}
    　　* @throws
    　　* @author anhaimeng
    　　* @date 2021/9/23 19:56
    　　*/
    public static Integer getCurrentAdminId(){
        Admin admin = (Admin) SecurityContextHolder.getContext().getAuthentication().getPrincipal();

        return admin.getId();

    }
}
